package homework.xuluoxi;

/*
 * 作业名称：实体类和接口 - 通话套餐类
 * 作业功能：实现实体类和接口
 * 学    员：徐罗希
 * 版    本：V1.0
 * 备    注：模块二作业
 */

public class CallPackage extends Package implements CallInterface {
    // 定义成员变量
    private int talkTime;
    private int message;

    // 构造方法
    public CallPackage() {}
    public CallPackage(int expense, int talkTime, int message) {
        super(expense);
        setTalkTime(talkTime);
        setMessage(message);
    }

    // get、set方法
    public int getTalkTime() {
        return talkTime;
    }
    public void setTalkTime(int talkTime) {
        this.talkTime = talkTime;
    }
    public int getMessage() {
        return message;
    }
    public void setMessage(int message) {
        this.message = message;
    }

    // 成员方法
    public void show() {
        System.out.println("您的通话套餐包含：" + getTalkTime() + "分钟通话，" + getMessage() + "条短信，每月资费为" + getExpense() + "元");
    }

    // 重写抽象方法
    @Override
    public void call(int talkTime, Card myC) {
        System.out.println("用户名：" + myC.getUserName() + "，剩余通话：" + talkTime + "分钟");
    }
}
